package com.kalixjyksh.record.api.model;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class RequestTimeUtil {
/**
 *
 * @author: WangHongWei
 * @date: 2018/12/10 0010 下午 2:37
 * @功能描述:  当天日期
 * @return: 
 * 
 */
    public static   String  getCurrentTime(){
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
        String sTime = format.format(new Date());
        return sTime;
    }

/**
 *
 * @author: WangHongWei
 * @date: 2018/12/10 0010 下午 2:37
 * @功能描述:  七天前日期
 * @return: 
 * 
 */

    public  static String  getPastTime(){
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
        Calendar c = Calendar.getInstance();
        c.setTime(new Date());
        c.add(Calendar.DATE, - 7);
        Date d = c.getTime();
        String lTime = format.format(d);
        return lTime;
    }
}
